<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>肇庆水务</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>

    <div id="mapContainer" style="position: relative;">
    </div>

</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    window.app = new GE.App('mapContainer', {
        position: [112.39764427644374, 23.0890549897819, 2500],
        lookAt: [112.39764427644374, 23.0890549897819, 0],
        cameraScrollSpeed: 15,
        minZoom: 14,
        maxZoom: 22,
        ambientLightIntensity: 3,
        ambientLightType: 'ambient',
        useCarpet: true,
        background: "Sky",
        useDefaultTexture: false, //是否使用瓦片默认纹理
        baseLayer: [
            // {
            //     // url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
            //     url: ' http://192.168.2.43:8081/zhaoqing_map/IMG/{z}/{y}/{x}.jpg',
            //     readableUrl: true,
            //     tileType: 'image',
            // },
            {
                url: ' http://192.168.2.43:8081/zhaoqing_map/IMG/{z}/{y}/{x}.jpg',
                // url: ' {ProductUrL}/zhaoqing_map/IMG/{z}/{y}/{x}.jpg',
                // url: 'http://192.168.2.43:8081/zhaoqing_map/DEM/{z}/{y}/{x}.lerc',
                // urlDecimal: TRUE,
                // url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
                // urlDecimal: true,
                // demUrl:'http://192.168.2.22:17035/sxtt/dem/SXDEM_ImageServer/_alllayers/{z}/{y}/{x}.lerc',
                demUrl: 'http://192.168.2.43:8081/zhaoqing_map/DEM/{z}/{y}/{x}.lerc',
                demUrlDecimal: true,
                demHeightAdjust: 0,
                // tileType: 'image',
                tileType: 'dem',
                canNotSelect: false, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
                maxDataLevel: 20
            }
        ]
    });
    app.on('Click', function (e) {
        console.log(e);
    });
    tiles3d();

    function tiles3d() {
        let tiles3d = new GE.Tiles3d({
            url: 'http://192.168.2.43:8081/zhaoqing/tileset.json',
            errorTarget: 30,
            z: 10,
            minSize: 200,
            maxSize: 2500,
        });
        app.add(tiles3d);
        window.tiles3d = tiles3d;
    }

    fbx();
    function fbx() {
        model = new GE.OverLay({
            // type: 'fbx',
            url: '/examples/resources/fbx/肇庆三榕净水厂/mod/Mod_三榕水厂_次氯化铝加药间.FBX',
            // url:'/examples/resources/fbx/肇庆三榕净水厂/供水.fbx',
            // url:'http://192.168.2.43:9000/examples/resources/fbx/box.gltf',
            position: [112.39838137484362, 23.091631954390355, 50],
            // scale: [100, 100, 100],
            // rotation: [45, 0, 0],
            changeEmissive: true,
            success: function () {
            }
        })
        app.add(model);

        model1 = new GE.OverLay({
            // type: 'fbx',
            url: '/examples/resources/fbx/肇庆三榕净水厂/有地形高度.fbx',
            // url:'/examples/resources/fbx/肇庆三榕净水厂/供水.fbx',
            // url:'http://192.168.2.43:9000/examples/resources/fbx/box.gltf',
            position: [112.39762914923921, 23.09158758035679, 0],
            // scale: [100, 100, 100],
            // rotation: [-90, 0, 0],
            changeEmissive: true,
            success: function () {
            }
        })
        app.add(model1);

        model2 = new GE.OverLay({
            // type: 'fbx',
            url: '/examples/resources/fbx/肇庆三榕净水厂/摄像头模型.FBX',
            // url:'/examples/resources/fbx/肇庆三榕净水厂/供水.fbx',
            // url:'http://192.168.2.43:9000/examples/resources/fbx/box.gltf',
            position: [112.39762914923921, 23.09158758035679, 30],
            scale: [100, 100, 100],
            // rotation: [-90, 0, 0],
            changeEmissive: true,
            success: function () {
            }
        })
        app.add(model2);

    }


    window.app.on('Click', function (e) {
        console.log(e);
    });
</script>

</html>